package com.example.demo.respository;

import com.example.demo.model.AppData;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface AppRepository extends CrudRepository<AppData, Long> {


    @Query(value = "select app0_.id as id1_0_,  app0_.name as name4_0_ from app app0_", nativeQuery = true)  //fail
    List<AppData> findUserList(String name);


    List<AppData> findUserByName(String name, Pageable page);
    List<AppData> findByname(String name);//success
    List<AppData> findBynameLike(String name);//success
//    List<User> findAll(Pageable page);
    Page<AppData> findAll(Pageable page);
}
